<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.14"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>sysmon: xsysmon_low_level_example.c File Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
  $(document).ready(initResizable);
</script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
<link href="HTML_custom.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectlogo"><img alt="Logo" src="xlogo_bg.gif"/></td>
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">sysmon
   </div>
   <div id="projectbrief">Xilinx SDK Drivers API Documentation</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.14 -->
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
$(function() {
  initMenu('',false,false,'search.php','Search');
});
</script>
<div id="main-nav"></div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
$(document).ready(function(){initNavTree('xsysmon__low__level__example_8c.html','');});
</script>
<div id="doc-content">
<div class="header">
  <div class="summary">
<a href="#func-members">Functions</a>  </div>
  <div class="headertitle">
<div class="title">xsysmon_low_level_example.c File Reference</div>  </div>
</div><!--header-->
<div class="contents">
<a name="details" id="details"></a><h2 class="groupheader">Overview</h2>
<div class="textblock"><p>This file contains a design example using the basic driver functions of the System Monitor driver. </p>
<p>The example here shows using the driver/device in polled mode to check the on-chip temperature and voltages.</p>
<dl class="section note"><dt>Note</dt><dd></dd></dl>
<p>The values of the on-chip temperature and the on-chip Vccaux voltage are read from the device and then the alarm thresholds are set in such a manner that the alarms occur.</p>
<pre></pre><pre>MODIFICATION HISTORY:</pre><pre>Ver   Who    Date     Changes
<hr/>

1.00a xd/sv  05/22/07 First release
2.00a sv     07/07/08 Changed the example to read 16 bits of data from the
                the ADC data registers.
4.00a ktn    10/22/09 Updated the example to use macros that have been
                renamed to remove _m from the name of the macro.
5.01a bss    03/13/12 Modified while loop condition to wait for EOS bit
                        to become high
5.03a bss    04/25/13 Modified SysMonLowLevelExample function to set
                Sequencer Mode as Safe mode instead of Single
                channel mode before configuring Sequencer registers.
                CR #703729
7.3   ms   01/23/17 Added xil_printf statement in main function to
                    ensure that "Successfully ran" and "Failed" strings
                    are available in all examples. This is a fix for
                    CR-965028.
</pre> </div><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
Functions</h2></td></tr>
<tr class="memitem:a112dd9ddb9d647627215a5bd349bce1f"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="xsysmon__low__level__example_8c.html#a112dd9ddb9d647627215a5bd349bce1f">SysMonLowLevelExample</a> (u32 BaseAddress)</td></tr>
<tr class="memdesc:a112dd9ddb9d647627215a5bd349bce1f"><td class="mdescLeft">&#160;</td><td class="mdescRight">This function runs a test on the System Monitor device using the basic driver functions.  <a href="#a112dd9ddb9d647627215a5bd349bce1f">More...</a><br /></td></tr>
<tr class="separator:a112dd9ddb9d647627215a5bd349bce1f"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a840291bc02cba5474a4cb46a9b9566fe"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="xsysmon__low__level__example_8c.html#a840291bc02cba5474a4cb46a9b9566fe">main</a> (void)</td></tr>
<tr class="memdesc:a840291bc02cba5474a4cb46a9b9566fe"><td class="mdescLeft">&#160;</td><td class="mdescRight">Main function that invokes the example given in this file.  <a href="#a840291bc02cba5474a4cb46a9b9566fe">More...</a><br /></td></tr>
<tr class="separator:a840291bc02cba5474a4cb46a9b9566fe"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<h2 class="groupheader">Function Documentation</h2>
<a id="a840291bc02cba5474a4cb46a9b9566fe"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a840291bc02cba5474a4cb46a9b9566fe">&#9670;&nbsp;</a></span>main()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int main </td>
          <td>(</td>
          <td class="paramtype">void&#160;</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Main function that invokes the example given in this file. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">None.</td><td></td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd><ul>
<li>XST_SUCCESS if the example has completed successfully.</li>
<li>XST_FAILURE if the example has failed.</li>
</ul>
</dd></dl>
<dl class="section note"><dt>Note</dt><dd>None. </dd></dl>

<p class="reference">References <a class="el" href="xsysmon__low__level__example_8c.html#a112dd9ddb9d647627215a5bd349bce1f">SysMonLowLevelExample()</a>.</p>

</div>
</div>
<a id="a112dd9ddb9d647627215a5bd349bce1f"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a112dd9ddb9d647627215a5bd349bce1f">&#9670;&nbsp;</a></span>SysMonLowLevelExample()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int SysMonLowLevelExample </td>
          <td>(</td>
          <td class="paramtype">u32&#160;</td>
          <td class="paramname"><em>BaseAddress</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>This function runs a test on the System Monitor device using the basic driver functions. </p>
<p>The function does the following tasks:</p><ul>
<li>Reset the device</li>
<li>Setup alarm thresholds for on-chip temperature and VCCAUX.</li>
<li>Setup sequence registers to continuously monitor on-chip temperature and VCCAUX.</li>
<li>Setup configuration registers to start the sequence.</li>
<li>Read latest on-chip temperature and VCCAUX, as well as their maximum and minimum values. Also check if alarm(s) are set.</li>
</ul>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">BaseAddress</td><td>is the XPAR_&lt;SYSMON_ADC_instance&gt;_BASEADDRESS value from xparameters.h.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>XST_SUCCESS</dd></dl>
<dl class="section note"><dt>Note</dt><dd>None. </dd></dl>

<p class="reference">References <a class="el" href="group__sysmon__v7__1.html#gafa412d1b4a44c7bd90f0a680c9560f9e">XSM_AOR_OFFSET</a>, <a class="el" href="group__sysmon__v7__1.html#gac40645b74aaa13f5a98f54766d9867c2">XSM_AOR_TEMP_MASK</a>, <a class="el" href="group__sysmon__v7__1.html#ga3298749348791ea76d1e35a9a1ab1b93">XSM_AOR_VCCAUX_MASK</a>, <a class="el" href="group__sysmon__v7__1.html#ga478302055c997f745c2bc5fdba027bec">XSM_ATR_TEMP_UPPER_OFFSET</a>, <a class="el" href="group__sysmon__v7__1.html#ga2095f9f31c92316cedc791e3e8c86ed7">XSM_ATR_VCCAUX_LOWER_OFFSET</a>, <a class="el" href="group__sysmon__v7__1.html#gafc393946fd912facd5f2d4791ff2cc71">XSM_ATR_VCCAUX_UPPER_OFFSET</a>, <a class="el" href="group__sysmon__v7__1.html#ga714515f968accaa6767fa3f54bef7716">XSM_CFR0_AVG16_MASK</a>, <a class="el" href="group__sysmon__v7__1.html#ga99615a4d0375c23c6852fa102fef061c">XSM_CFR0_AVG_VALID_MASK</a>, <a class="el" href="group__sysmon__v7__1.html#ga9336095a2666fc857fe4767577420af0">XSM_CFR0_OFFSET</a>, <a class="el" href="group__sysmon__v7__1.html#ga306d1f6c4636d8a6d5a6177c3f64456b">XSM_CFR1_ALM_ALL_MASK</a>, <a class="el" href="group__sysmon__v7__1.html#ga52a6fb60ad44e0e4b95c4c54e331bc5c">XSM_CFR1_ALM_TEMP_MASK</a>, <a class="el" href="group__sysmon__v7__1.html#ga426292488bb2aee0969e533223757104">XSM_CFR1_ALM_VCCAUX_MASK</a>, <a class="el" href="group__sysmon__v7__1.html#ga77db578b03b4cf82413863cea04bfd3e">XSM_CFR1_OFFSET</a>, <a class="el" href="group__sysmon__v7__1.html#ga3d9b9857b714dc99bd794390dec92057">XSM_CFR1_SEQ_CONTINPASS_MASK</a>, <a class="el" href="group__sysmon__v7__1.html#ga2d716c0404815b90c9aa5634d6be376f">XSM_CFR1_SEQ_SAFEMODE_MASK</a>, <a class="el" href="group__sysmon__v7__1.html#gaea9829dd8e98497f85cf41773984ae98">XSM_CFR1_SEQ_VALID_MASK</a>, <a class="el" href="group__sysmon__v7__1.html#gae434c1a3fb0dc9e263f4997012ddbc43">XSM_CFR2_CD_SHIFT</a>, <a class="el" href="group__sysmon__v7__1.html#ga170da43233d9db7de76001ad7f9e0339">XSM_CFR2_OFFSET</a>, <a class="el" href="group__sysmon__v7__1.html#ga56fd7ed2eba0cb4e23e3aac41138a1c1">XSM_MAX_TEMP_OFFSET</a>, <a class="el" href="group__sysmon__v7__1.html#gabf55f467408bbb4d6a236abdb0f23048">XSM_MAX_VCCAUX_OFFSET</a>, <a class="el" href="group__sysmon__v7__1.html#ga26bbf821be4987c9364f2032b21751ec">XSM_MIN_TEMP_OFFSET</a>, <a class="el" href="group__sysmon__v7__1.html#gafb4961ea4bd8f471f20a5cf5bda146ba">XSM_MIN_VCCAUX_OFFSET</a>, <a class="el" href="group__sysmon__v7__1.html#ga63cf076fa86ef531a0404b58df7a350e">XSM_SEQ00_OFFSET</a>, <a class="el" href="group__sysmon__v7__1.html#gaff2f92d84c1f83a4efe1928084b57341">XSM_SEQ01_OFFSET</a>, <a class="el" href="group__sysmon__v7__1.html#ga8864a8a3dc09b70037bb1692cb197cd4">XSM_SEQ02_OFFSET</a>, <a class="el" href="group__sysmon__v7__1.html#ga6313d68779a92a476b4cc63facde66ea">XSM_SEQ03_OFFSET</a>, <a class="el" href="group__sysmon__v7__1.html#ga1b75d0d8402dd90637c33fde0487cbc7">XSM_SEQ05_OFFSET</a>, <a class="el" href="group__sysmon__v7__1.html#ga4307b076b50869c8338c867fd488a868">XSM_SEQ07_OFFSET</a>, <a class="el" href="group__sysmon__v7__1.html#ga7a2f95ce30a1155b39edd9384e6d898a">XSM_SEQ_CH_AUX00</a>, <a class="el" href="group__sysmon__v7__1.html#gaee1c4b7f6daf995c00e384a844581230">XSM_SEQ_CH_AUX15</a>, <a class="el" href="group__sysmon__v7__1.html#gac110cd89b4eb9a358c0d5dbf74aadd9a">XSM_SEQ_CH_AUX_SHIFT</a>, <a class="el" href="group__sysmon__v7__1.html#ga4fed5630d5bcefd6b2c8b4692a5cb579">XSM_SEQ_CH_TEMP</a>, <a class="el" href="group__sysmon__v7__1.html#ga5426b215d0d905d01876ba679f08fbe5">XSM_SEQ_CH_VCCAUX</a>, <a class="el" href="group__sysmon__v7__1.html#gac10ed891373f4799aa33110441cb5595">XSM_SR_EOS_MASK</a>, <a class="el" href="group__sysmon__v7__1.html#gaaba7d7c2a7407d9c762149d5f0baeb42">XSM_SR_OFFSET</a>, <a class="el" href="group__sysmon__v7__1.html#gaba04d634f6590268f5d5010ac67221c1">XSM_SRR_IPRST_MASK</a>, <a class="el" href="group__sysmon__v7__1.html#gadd7076ff49ebebb01d1e16560a766438">XSM_SRR_OFFSET</a>, <a class="el" href="group__sysmon__v7__1.html#gae8af46587c4cd6d21563b2bd556b3cdb">XSM_TEMP_OFFSET</a>, <a class="el" href="group__sysmon__v7__1.html#gacdcbc2014de5b44c22fd3039f679273e">XSM_VCCAUX_OFFSET</a>, <a class="el" href="group__sysmon__v7__1.html#ga9c287afa2245c955bd1fbcd8ed4f9b02">XSysMon_ReadReg</a>, and <a class="el" href="group__sysmon__v7__1.html#ga145c5d79fcbe0223c3427d91f03c95e5">XSysMon_WriteReg</a>.</p>

<p class="reference">Referenced by <a class="el" href="xsysmon__low__level__example_8c.html#a840291bc02cba5474a4cb46a9b9566fe">main()</a>.</p>

</div>
</div>
</div><!-- contents -->
</div><!-- doc-content -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
  <ul>
    <li class="footer">Copyright &copy; 2015 Xilinx Inc. All rights reserved.</li>
  </ul>
</div>
</body>
</html>
